const app = {
  state: {
    userInfo: null,
    payCardInfo: null,
    orderList: [],
  },
  mutations: {
    UPDATE_APP_USERINFO(state, userInfo) {
      state.userInfo = state.userInfo == null ? userInfo : Object.assign(state.userInfo, userInfo);
    },
    UPDATE_APP_USERINFO_EMPTY(state) {
      state.userInfo = null;
    },
    UPDATE_APP_PAYCARDINFO(state, payCardInfo) {
      state.payCardInfo = state.payCardInfo == null ? payCardInfo : Object.assign(state.payCardInfo, payCardInfo);
    },
    UPDATE_APP_ORDERLIST(state, order) {
      state.orderList = state.payCardInfo.push(order);
    },
  }
};

export default app;
